// Groups

SS.Groups      = {}
SS.Groups.List = {}

// Rank

function SS.Groups.Rank(ID)
	local Return = 0
	
	if (SS.Groups.List[ID]) then
		Return = SS.Groups.List[ID][3]
	end
	
	return Return
end

// Setup group

function SS.Groups.Setup(Message)
	local ID = Message:ReadString()
	
	local Index = Message:ReadShort()
	local R     = Message:ReadShort()
	local G     = Message:ReadShort()
	local B     = Message:ReadShort()
	local A     = Message:ReadShort()
	local Rank  = Message:ReadShort()
	
	local Col = Color(R, G, B, A)
	
	Msg("\n[SS] Creating Team '"..ID.."'\n")
	
	team.SetUp(Index, ID, Col)
	
	SS.Groups.List[Index] = {ID, Col, Rank}
end

usermessage.Hook("SS.Groups.Setup", SS.Groups.Setup)